<!DOCTYPE html>
<html ng-app="loginApp">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>登录</title>
    <link rel="icon" type="image/x-icon" href="image/111111.ico">
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/page.css">
    <script type="text/javascript" src="js/jBASE64.js"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
</head>
<body ng-controller="loginController">

<div class="header-login">
    <p class="logo pl100 f14" id="logo" style="font-family: 'Microsoft YaHei'">INTELAB物联网云监控系统 by iLabService</p>
</div>
<div class="content" style=" background: url('image/loginBg.jpg')  no-repeat;filter: alpha(opacity=40); opacity: .8 ;background-size:100%; margin-top:-1px; padding: 0">
    <div class="content-layout">
        <div class="Loginleft-box">
            <p style="color:white; font-size: 46px; font-family: 'Microsoft YaHei'; line-height: 1.2em ">欢迎使用INTELAB物联网云监控系统</p>
            <p class="login-imgstyle">
                <span><img src="image/plateImg.png" style="width: 118px; height: 35px"></span>
                <span ng-show="hasCompany==1"><img ng-src="{{serviceHttp+companyLogo}}" style="width: 108px; height: 35px;padding-left:20px; border-left: 1px solid white"></span>
            </p>
            <div style="width:100%; text-align:left; margin-top: 130px;  font-size: 14px; color: white">
                Powered by iLabService
            </div>
        </div>
        <div class="login-box">
            <div class="static-form " id="J_StaticForm">
                <form id="userform" name="userform">
                    <div class="field username-field">
                        <label><i class="iconfont" title="用户名"><img src="image/user.png" class="logo-icon"></i></label>
                        <input type="text" name="userName" id="userName" required  ng-model="userName" placeholder="请输入用户名"
                               class="login-text J_UserName highlight" value="" maxlength="32" autoComplete='off'/>
                        <span  class="nickx" href="javascript:void(0)" style="display: block;">
                            <img id="nickx-icon" src="image/icon-del.png" style="width: 16px; height: 16px">
                        </span>
                    </div>
                    <div class="field pwd-field">
                        <label id="password-label">
                            <i class="icon iconfont" title="登录密码"><img src="image/pwd.png" class="logo-icon"></i>
                        </label>
				<span>
				   <input type="password" id="userPwd" name="userPwd" required ng-model="userPwd" placeholder="请输入密码"
                          class="login-text highlight"
                          maxlength="40" ng-keyup="myKeyup($event)"/>
				</span>
                    </div>
                    <div class="rememberPwd">
                        <span class="chk-field"><input id="saveCookie" name="saveCookie" type="checkbox" class="" style="vertical-align:middle;margin-right: 5px">记住账户密码</span>
                        <span class="remPwd-field"><a href="javascript:void(0)" class="pl15" ng-click="forgetPassword()">忘记登录密码？</a></span>
                    </div>
                    <p id="pleaceHolder" ng-show="error && !error.success">{{error.message}}</p>
                    <div class="submit">
                        <button type="submit" class="J_Submit" tabindex="3" data-ing="正在登录..." ng-click="Login()">登 录</button>
                    </div>
                </form>
            </div>
        </div>
        <div style="clear: both"></div>

    </div>
</div>
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript" src="js/angular-route.min.js"></script>
<script type="text/javascript" src="controller/ControLogin.js"></script>
<script type="text/javascript" src="js/cookie.js"></script>
<script type="text/javascript" >
    window.onload = function () {
        var windowWidth =  $(window).width();//浏览器宽度
        var windowHeight = $(window).height();//浏览器高度
        var contentWidth =  $(".content-layout").width(); //content-layout的宽度
        $(".content-layout").css('margin-left',(windowWidth-contentWidth)/1.2);
        $(".content-layout").css({'height':windowHeight - '150'});
//        $.ajax({
//            type: "get",
//            url: serviceHttp  + 'api/rest/operate/is/login',
//            dataType: "json",
//            success: function (data) {
//                if(data.error == 0){
//                    alert(data.message)
//               //     window.open('about:blank','_self'); window.close();
//                };
//            },
//            error: function (XMLHttpRequest, textStatus, errorThrown) {
//                alert("异常错误");
//            }
//        });
    };

    $(function () {
        deleteCookie("userName","/");
        deleteCookie("userPwd","/");
//        $("#saveCookie").removeAttr('checked');
        $("#nickx-icon").css('display','none');
       //文本框得到焦点事件
        $("#userName").bind('focus',function () {
            var l = $("#userName").val().length;
            if(l && l>0){
                $("#nickx-icon").css('display','block');
            }else{
                $("#nickx-icon").css('display','none');
            }
        });
       //监听文本框变化事件
        $("#userName").bind('input propertychange',function () {
            var l = $("#userName").val().length;
            if(l && l>0){
                $("#nickx-icon").css('display','block');
            }else{
                $("#nickx-icon").css('display','none');
            }
        });

        $("#nickx-icon").click(function () {
            $("#userName").val("");
        });

    });
</script>
</body>
</html>
